<extend name="_Layout/main"/>

<block name="main">
   <style type="text/css">
			[class*=am-u-]{padding-left:0;padding-right: 0;}
			ol, ul{padding: 0; margin: 0;}
			.m-middle{ width: 700px;   margin: 40px auto 60px auto;}
			.m-middle h2{color: #000; padding: 20px 0 15px 0; border-bottom: 1px solid #e5e5e5; font-size: 22px; margin-bottom: 50px;}
			.m-middle p{clear: both; margin-bottom: 20px; height: auto; overflow: hidden; text-indent: 0;}
			.m-middle p lable{display: block; width: 100px; float: left; color: #000; margin-right: 8px;line-height: 45px; 				font-size: 18px;}
			.m-middle p input{ display: block; width: 343px; height: 43px; float: left; background: #f2f2f2; 
			border: 1px solid #ccc;}
			.m-middle button{border: 0; width: 200px; height: 50px; display: block; background: url(./Application/Home/View/default/_Resource/img/button.png) top center no-repeat; color:#fff; line-height: 40px; font-size: 16px; margin-left: 110px; margin-top: 30px;}
			.resiterM{margin-top: 40px; margin-left: 50px; clear: both;}
	
		</style>
		<section class="banner">
			<img src="./Application/Home/View/default/_Resource/img/banner3.png" />
		</section>
		<section class="exchange-center" style="height: 650px;">
			<div class="am-breadcrumb-bg">
				<div class="uwidth1">
					<ol class="am-breadcrumb am-text-right">
					  <li><a href="#">首页</a></li>
					  <li><a href="#">分类</a></li>
					  <li class="am-active">立即注册</li>
					</ol>
				</div>
			</div>
			<div class="uwidth1 am-posre" >
			<!-- <form action="{:U('Home/User/register')}" method="post" class="form builder-form"> -->
				<div class="m-middle">
					<h2>立即注册</h2>
					<div class="resiterM">
					<p><lable>登录账户：</lable><input name='username'value="" ></p>
					<p><lable>真实姓名：</lable><input name='realname'value="" ></p>
					<p><lable>手机号：</lable><input  name='mobile'value="" ></p>
					<p><lable>推荐人：</lable><input onkeyup='checkref()' name='referee'value="" ><span class="refeUser"></span></p>
					<p><lable>登录密码：</lable><input type='password'name='password'value="" ></p>
					<p><lable>交易密码：</lable><input type='password'name='two_password'value="" ></p>
					<button onclick='userReg()'>立即注册</button>
					</div>
				</div>
			<!-- </form> -->
			</div>
		</section>
<script>
function checkref()
{
	var referee=$('input[name=referee]').val();
	$.getJSON("./index.php?s=/Home/User/checkUser",{referee:referee},function(json){
		$('.refeUser').html(json.name);	
	});
}
 function userReg()
{
	var username=$('input[name=username]').val();
	var realname=$('input[name=realname]').val();
	var mobile=$('input[name=mobile]').val();
	var password=$('input[name=password]').val();
	var referee=$('input[name=referee]').val();
	var two_password=$('input[name=two_password]').val();
	$.getJSON("./index.php?s=/Home/User/reg_user",{referee:referee,username:username,realname:realname,mobile:mobile,password:password,two_password:two_password},function(json){
			if(json.status)
			{
				layer.msg(json.msg, {time: 3000,btn: []});
				if(json.url != '')
				{
					location=json.url;	
				}
			}else{
				layer.msg(json.msg);
			}
    });
}
</script>
</block>
